﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PagedList<CourseSystem.Core.Entities.PostsInfo>>" %>
<%@ Import Namespace="Chowpoo.Util" %>
<%@ Import Namespace="CourseSystem.Common.Helpers" %>
<%@ Import Namespace="CourseSystem.Core.Enum" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
 <% 
       var isDigest = ViewData["isDigest"].CheckInt(0);
    %>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
    <% int i = Model.PageSize * (Model.CurrentPageIndex - 1);

       foreach (var item in Model)
       {
           i++;
           
    %>
    <tr class="style1">
        <td width="20%" valign="top">
            第<%=i %>楼:<%=item.PosterName %><br />
            <%=item.PostTime.ToString("yyyy-MM-dd HH:mm") %><br />
            <% if (InterActionHelper.IsHasPower(item))
               { %><%= Html.ActionButton("编辑", "Posts", new { item.Id, isDigest })%>
            <% } %>
            <% if (InterActionHelper.IsHasDelPower(item))
               { %><%= Html.ActionButton("删除", "PostsDel", new { item.Id, isDigest }, new { confirm = "confirm('确定删除?')" })%><% } %>
        </td>
        <td valign="top" align="left">
             标题:<%=item.Title %><br />
            <%=item.Message %>
        </td>
    </tr>
    <% } %>
</table>
<table width="98%" height="7" border="0" align="center" cellpadding="0" cellspacing="0"
    bordercolor="#FFFFFF">
    <tr>
        <td class="gray12">
            &nbsp;
        </td>
        <td align="right" class="gray12">
            <%=Html.AjaxPager(Model, new PagerOptions() { ContainerTagName = "span", CssClass = "mvcPager", PageIndexParameterName = "pid", ShowMorePagerItems = false, AlwaysShowFirstLastPageNumber = true, }, new AjaxOptions() { UpdateTargetId = "listDiv" })%>
            共<%=Model.TotalItemCount %>条记录，页<%=Model.CurrentPageIndex %>/<%=Model.TotalPageCount %>
        </td>
    </tr>
</table>
